package com.example.config;

import com.example.factory.SysAdminServerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JobAdminConfig {

    @Value("${job.admin.corePoolSize:10}")
    private int corePoolSize;

    @Value("${job.admin.maximumPoolSize:20}")
    private int maximumPoolSize;

    @Value("${job.admin.keepAliveTime:5}")
    private long keepAliveTime;

    @Bean
    public SysAdminServerFactory sysAdminServerFactory() {
        return new SysAdminServerFactory(corePoolSize, maximumPoolSize, keepAliveTime);
    }
}
